#include "main.h"


void main(void)
{
    clk_enable();
    led_init();
    beep_init();
    key_init();
    
    int i = 0;
    uint8_t led_state = 0;
    uint8_t beep_state = 0;
    uint8_t key_value = 0;

    while (1)
    {
        key_value = key_getvalue();
        if(key_value)
        {
            switch(key_value)
            {
                case key0_down:
                    beep_state = !beep_state;
                    beep_switch(beep_state);
                    break;
            }
        }

        i++;
        if(i >= 50)
        {
            i = 0;
            led_state = !led_state;
            led_switch(led_state);
        }
        delay(10);
    }
}
